package com.tul.exercise.base.string.format;

import java.util.ArrayList;
import java.util.List;
import static com.tul.exercise.base.utils.Print.*;
/**
 * @Description 《java编程思想》第13章 示例5：
 *
 * 正确的打印对象的地址
 *
 **/
public class InfiniteResursion {

    public String toString() {
        //return " InfiniteResursion address: " + this + "\n";

        return " InfiniteResursion address: " + super.toString() + "\n";
    }

    public static void main(String[] args) {
        List<InfiniteResursion> v = new ArrayList<>();
        for(int i=0;i<10;i++) {
            v.add(new InfiniteResursion());
        }

        //System.out.println(v);
        print(v);
    }
}
